<script setup>
import BasePanel from "@/views/demo/BasePanel.vue";
import {ref} from "vue";

// const uid=ref(Math.random().toString(36).slice(2,6))
const uid=ref('abcd')
let taskNum=ref()
let connStatus=ref(false)
let btnName=ref('连接')

//方法
function connectServ(){
  if(connStatus.value){
    connStatus.value=false
    btnName.value='连接'
  }else{
    connStatus.value=true
    btnName.value='断开'
  }

}



</script>

<template>
  <label>{{uid}}</label>
  <el-input :readonly="connStatus" v-model="taskNum" />
  <el-button @click="connectServ">{{btnName}}</el-button>
  <BasePanel v-if="connStatus"  :taskId="taskNum" :uid="uid" />

</template>

<style scoped>

</style>
